/*
 * ESHealthyHelix.cs
 *
 * Created on December 30, 2007, 8:31 PM
 *
 * Copyright (C) 2007-2008  Hylke van der Schaaf
 * Copyright (C) 2010       Mathijs Miermans
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, in version 3 of the License.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */


using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;


namespace HexTD
{
	public class ESHealthyHelix : EnemySpriteBaseRotor
	{

		private float healingRate = 0.05f / 20f;

		/** Creates a new instance of ESHealthyHelix */
		public ESHealthyHelix(Game game)
			: base(game, "Healthy Helix", true)
		{
			this.rotPerTime = (float)ExtendMath.DegreeToRadian(10.0);
			this.damageColor = COLOR.OTHER;
			this.damageColorAnti = COLOR.OTHER;
		}

		protected override void doInit(Context context, int path, float delay, long health, int price, Size s)
		{
#if PORT
			context.loadSvg("hh", "images\\image1.svg");
#endif
			base.doInit(context, path, delay, health, price, s);
		}

		public override string getInfostring()
		{
			string retstring = "";
			retstring += "<h1>Healthy Helix</h1>" +
					"<p>" +
					"This enemy regenerates it's health. " +
					"It takes about 20 seconds to go from near-dead to fully healed. " +
					"Wounding them is meaningless, you have to kill them fast!" +
					"</p>" +
					"<p>" + base.getInfostring() + "</p>";
			return retstring;
		}

		public override void doTick(int gameTime)
		{
			if (!this.inactive && !this.dead)
			{
				if (this.health < this.healthMax)
				{
					this.health += Math.Max(1L, (long)(this.healthMax * this.healingRate));
					if (this.health > this.healthMax)
					{
						this.health = this.healthMax;
					}
					this.fireStatusChangedEvent();
				}
			}
			base.doTick(gameTime);
		}

		public override Color generateColor()
		{
			return Color.Transparent;
		}

#if PORT
		public override Brush generateStroke()
		{
			return null;
		}

		public override Shape generateShape()
		{
			return null;
		}
#endif

		public override string getSvgName()
		{
			return "hh";
		}
	}
}